package com.cxy.contentcenter.controller.content;

import com.cxy.contentcenter.auth.CheckAuthorization;
import com.cxy.contentcenter.domain.dto.content.ShareAuditDTO;
import com.cxy.contentcenter.domain.entity.content.Share;
import com.cxy.contentcenter.service.content.ShareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: huayushu luming
 * @date: 2020-11-29 22:19
 * @desc:
 **/
@RestController
@RequestMapping("/admin/shares")
public class ShareAdminController {
    @Autowired
    private ShareService shareService;
    @PutMapping("/audit/{id}")
    @CheckAuthorization("admin")
    public Share auditById(@PathVariable  Integer id, @RequestBody  ShareAuditDTO auditDTO){
        //TODO 认证 、授权
        return  this.shareService.auditById(id,auditDTO);
    }
}
